home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-1.iso / Files / System 7 / Powerbook / The Regulator 1.2.sit / The Regulator source / main.c < prev    next >
MacBinary  |  1992-06-19  |  9.4 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: main.c

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
10% dexvert Jesper Olsen Module (music/jesperOlsen) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Fri Jun 19 12:02:08 1992, modified Fri Jun 19 12:02:08 1992, creator Think C, type ASCII, 8938 bytes "main.c" , at 0x236a 428 bytes resource default (weak)
99% file data default
49% TrID Macintosh plain text (MacBinary) default
33% TrID TTComp archive compressed (bin-4K) default (weak)
16% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 06 6d 61 69 6e 2e 63 | 00 00 00 00 00 00 00 00 |..main.c|........|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 00 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 22 ea 00 | 00 01 ac a6 67 b5 80 a6 |....."..|....g...|
|00000060| 67 b5 80 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |g.......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 b0 79 00 00 |........|.....y..|
|00000080| 2f 2a 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |/*------|--------|
|00000090| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000d0| 0d 23 0d 23 20 20 20 41 | 70 70 6c 65 20 44 65 76 |.#.# A|pple Dev|
|000000e0| 65 6c 6f 70 65 72 20 54 | 65 63 68 6e 69 63 61 6c |eloper T|echnical|
|000000f0| 20 53 75 70 70 6f 72 74 | 0d 23 0d 23 20 53 6d 61 | Support|.#.# Sma|
|00000100| 6c 6c 44 61 65 6d 6f 6e | 0d 23 20 41 20 73 6d 61 |llDaemon|.# A sma|
|00000110| 6c 6c 20 66 61 63 65 6c | 65 73 73 20 62 61 63 6b |ll facel|ess back|
|00000120| 67 72 6f 75 6e 64 2d 6f | 6e 6c 79 20 61 70 70 6c |ground-o|nly appl|
|00000130| 69 63 61 74 69 6f 6e 0d | 23 0d 23 20 20 20 6d 61 |ication.|#.# ma|
|00000140| 69 6e 2e 63 20 20 2d 20 | 20 20 43 20 53 6f 75 72 |in.c - | C Sour|
|00000150| 63 65 0d 23 0d 23 20 20 | 20 43 6f 70 79 72 69 67 |ce.#.# | Copyrig|
|00000160| 68 74 20 a9 20 31 39 39 | 31 20 41 70 70 6c 65 20 |ht . 199|1 Apple |
|00000170| 43 6f 6d 70 75 74 65 72 | 2c 20 49 6e 63 2e 0d 23 |Computer|, Inc..#|
|00000180| 20 20 20 41 6c 6c 20 72 | 69 67 68 74 73 20 72 65 | All r|ights re|
|00000190| 73 65 72 76 65 64 2e 0d | 23 0d 23 20 20 20 56 65 |served..|#.# Ve|
|000001a0| 72 73 69 6f 6e 73 3a 20 | 20 20 0d 23 20 20 20 20 |rsions: | .# |
|000001b0| 20 20 20 20 20 20 20 20 | 20 20 20 31 2e 30 20 20 | | 1.0 |
|000001c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 30 39 2f | | 09/|
|000001d0| 39 31 20 20 20 20 20 20 | 20 43 2e 4b 2e 20 48 61 |91 | C.K. Ha|
|000001e0| 75 6e 20 3c 54 52 3e 0d | 23 20 20 20 0d 23 20 20 |un <TR>.|# .# |
|000001f0| 20 43 6f 6d 70 6f 6e 65 | 6e 74 73 3a 0d 23 20 20 | Compone|nts:.# |
|00000200| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000210| 20 20 20 20 20 20 20 20 | 20 6d 61 69 6e 2e 63 0d | | main.c.|
|00000220| 23 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |# | |
|00000230| 20 20 20 20 20 20 20 20 | 20 20 20 20 41 70 70 6c | | Appl|
|00000240| 65 45 76 65 6e 74 73 2e | 63 0d 23 0d 23 20 54 68 |eEvents.|c.#.# Th|
|00000250| 69 73 20 69 73 20 61 20 | 5f 76 65 72 79 5f 20 73 |is is a |_very_ s|
|00000260| 69 6d 70 6c 65 20 73 61 | 6d 70 6c 65 20 73 68 6f |imple sa|mple sho|
|00000270| 77 69 6e 67 20 61 20 64 | 6f 2d 6e 6f 74 68 69 6e |wing a d|o-nothin|
|00000280| 67 20 0d 23 20 53 79 73 | 74 65 6d 20 37 2e 30 20 |g .# Sys|tem 7.0 |
|00000290| 66 61 63 65 6c 65 73 73 | 20 62 61 63 6b 67 72 6f |faceless| backgro|
|000002a0| 75 6e 64 20 61 70 70 6c | 69 63 61 74 69 6f 6e 2e |und appl|ication.|
|000002b0| 20 20 0d 23 20 0d 23 20 | 54 68 65 20 6d 61 69 6e | .# .# |The main|
|000002c0| 20 74 68 69 6e 67 73 20 | 74 6f 20 6e 6f 74 65 20 | things |to note |
|000002d0| 61 72 65 2e 2e 2e 2e 0d | 23 20 31 29 20 20 4c 6f |are.....|# 1) Lo|
|000002e0| 6f 6b 20 61 74 20 74 68 | 65 20 53 49 5a 45 20 72 |ok at th|e SIZE r|
|000002f0| 65 73 6f 75 72 63 65 20 | 66 6f 72 20 74 68 65 20 |esource |for the |
|00000300| 66 6c 61 67 20 73 65 74 | 74 69 6e 67 73 20 79 6f |flag set|tings yo|
|00000310| 75 27 6c 6c 0d 23 20 20 | 6e 65 65 64 20 74 6f 20 |u'll.# |need to |
|00000320| 6c 65 74 20 74 68 65 20 | 46 69 6e 64 65 72 aa 20 |let the |Finder. |
|00000330| 6b 6e 6f 77 20 74 68 61 | 74 20 79 6f 75 20 6f 6e |know tha|t you on|
|00000340| 6c 79 20 77 61 6e 74 20 | 74 6f 20 77 6f 72 6b 0d |ly want |to work.|
|00000350| 23 20 20 69 6e 20 74 68 | 65 20 62 61 63 6b 67 72 |# in th|e backgr|
|00000360| 6f 75 6e 64 2e 0d 23 20 | 32 29 20 4e 6f 74 69 63 |ound..# |2) Notic|
|00000370| 65 20 74 68 61 74 20 79 | 6f 75 20 72 65 61 6c 6c |e that y|ou reall|
|00000380| 79 20 64 6f 20 68 61 76 | 65 20 79 6f 75 72 20 6f |y do hav|e your o|
|00000390| 77 6e 20 68 65 61 70 20 | 61 6e 64 20 79 6f 75 72 |wn heap |and your|
|000003a0| 20 6f 77 6e 0d 23 20 20 | 65 76 65 6e 74 20 6c 6f | own.# |event lo|
|000003b0| 6f 70 2e 20 20 59 6f 75 | 20 63 61 6e 20 64 6f 20 |op. You| can do |
|000003c0| 61 6e 79 74 68 69 6e 67 | 20 61 20 66 6f 72 65 67 |anything| a foreg|
|000003d0| 72 6f 75 6e 64 20 61 70 | 70 6c 69 63 61 74 69 6f |round ap|plicatio|
|000003e0| 6e 0d 23 20 20 63 61 6e | 20 64 6f 2c 20 73 65 6e |n.# can| do, sen|
|000003f0| 64 20 41 70 70 6c 65 45 | 76 65 6e 74 73 2c 20 50 |d AppleE|vents, P|
|00000400| 50 43 20 73 74 75 66 66 | 2c 20 61 6e 79 74 68 69 |PC stuff|, anythi|
|00000410| 6e 67 20 65 6c 73 65 20 | 79 6f 75 27 64 0d 23 20 |ng else |you'd.# |
|00000420| 20 6c 69 6b 65 20 45 58 | 43 45 50 54 20 61 20 67 | like EX|CEPT a g|
|00000430| 72 61 70 68 69 63 20 69 | 6e 74 65 72 66 61 63 65 |raphic i|nterface|
|00000440| 2e 0d 23 20 33 29 20 20 | 4e 4f 54 45 20 74 68 61 |..# 3) |NOTE tha|
|00000450| 74 20 6e 6f 20 6d 61 6e | 61 67 65 72 73 20 61 72 |t no man|agers ar|
|00000460| 65 20 73 74 61 72 74 65 | 64 20 75 70 2e 20 20 59 |e starte|d up. Y|
|00000470| 6f 75 20 63 61 6e 6e 6f | 74 20 73 74 61 72 74 20 |ou canno|t start |
|00000480| 75 70 0d 23 20 20 57 69 | 6e 64 6f 77 2c 20 4d 65 |up.# Wi|ndow, Me|
|00000490| 6e 75 2c 20 44 69 61 6c | 6f 67 73 2c 20 6f 72 20 |nu, Dial|ogs, or |
|000004a0| 61 6e 79 74 68 69 6e 67 | 20 65 6c 73 65 20 74 68 |anything| else th|
|000004b0| 61 74 20 0d 23 20 20 64 | 65 61 6c 73 20 77 69 74 |at .# d|eals wit|
|000004c0| 68 20 74 68 65 20 67 72 | 61 70 68 69 63 20 66 72 |h the gr|aphic fr|
|000004d0| 6f 6e 74 20 65 6e 64 2e | 20 20 4a 75 73 74 20 6c |ont end.| Just l|
|000004e0| 65 61 76 65 20 74 68 65 | 6d 20 6f 75 74 2e 0d 23 |eave the|m out..#|
|000004f0| 20 20 59 6f 75 20 5f 63 | 61 6e 5f 20 73 74 61 72 | You _c|an_ star|
|00000500| 74 20 75 70 20 51 75 69 | 63 6b 44 72 61 77 2c 20 |t up Qui|ckDraw, |
|00000510| 69 66 20 79 6f 75 20 77 | 61 6e 74 20 74 6f 20 75 |if you w|ant to u|
|00000520| 73 65 20 73 6f 6d 65 20 | 51 75 69 63 6b 44 72 61 |se some |QuickDra|
|00000530| 77 0d 23 20 20 66 75 6e | 63 74 69 6f 6e 73 20 28 |w.# fun|ctions (|
|00000540| 6c 69 6b 65 20 6f 66 66 | 73 63 72 65 65 6e 20 70 |like off|screen p|
|00000550| 6f 72 74 73 29 2c 20 62 | 75 74 20 79 6f 75 20 43 |orts), b|ut you C|
|00000560| 41 4e 4e 4f 54 20 61 63 | 74 75 61 6c 6c 79 20 0d |ANNOT ac|tually .|
|00000570| 23 20 20 64 6f 20 61 6e | 79 20 73 63 72 65 65 6e |# do an|y screen|
|00000580| 20 64 72 61 77 69 6e 67 | 2e 0d 23 0d 23 20 4f 66 | drawing|..#.# Of|
|00000590| 20 63 6f 75 72 73 65 2c | 20 61 20 62 61 63 6b 67 | course,| a backg|
|000005a0| 72 6f 75 6e 64 65 72 20 | 63 61 6e 20 62 65 20 6c |rounder |can be l|
|000005b0| 61 75 6e 63 68 65 64 20 | 66 72 6f 6d 20 74 68 65 |aunched |from the|
|000005c0| 20 46 69 6e 64 65 72 aa | 20 0d 23 20 77 69 74 68 | Finder.| .# with|
|000005d0| 20 61 20 64 6f 75 62 6c | 65 2d 63 6c 69 63 6b 2e | a doubl|e-click.|
|000005e0| 20 20 48 6f 77 65 76 65 | 72 2c 20 69 66 20 79 6f | Howeve|r, if yo|
|000005f0| 75 27 64 20 6c 69 6b 65 | 20 74 68 65 20 62 61 63 |u'd like| the bac|
|00000600| 6b 67 72 6f 75 6e 64 65 | 72 0d 23 20 74 6f 20 70 |kgrounde|r.# to p|
|00000610| 65 72 66 6f 72 6d 20 73 | 6f 6d 65 20 75 73 65 66 |erform s|ome usef|
|00000620| 75 6c 20 73 65 72 76 69 | 63 65 20 66 6f 72 20 79 |ul servi|ce for y|
|00000630| 6f 75 72 20 6d 61 69 6e | 20 61 70 70 6c 69 63 61 |our main| applica|
|00000640| 74 69 6f 6e 2c 20 64 72 | 69 76 65 72 2c 0d 23 20 |tion, dr|iver,.# |
|00000650| 44 41 2c 20 6f 72 20 77 | 68 61 74 65 76 65 72 2c |DA, or w|hatever,|
|00000660| 20 79 6f 75 20 77 69 6c | 6c 20 77 61 6e 74 20 69 | you wil|l want i|
|00000670| 74 20 72 75 6e 6e 69 6e | 67 20 61 6c 6c 20 74 68 |t runnin|g all th|
|00000680| 65 20 74 69 6d 65 2e 0d | 23 20 20 54 68 65 20 42 |e time..|# The B|
|00000690| 45 53 54 20 77 61 79 20 | 74 6f 20 69 6e 73 75 72 |EST way |to insur|
|000006a0| 65 20 74 68 69 73 20 69 | 73 20 74 6f 20 69 6e 73 |e this i|s to ins|
|000006b0| 74 61 6c 6c 20 74 68 65 | 20 62 61 63 6b 67 72 6f |tall the| backgro|
|000006c0| 75 6e 64 65 72 20 69 6e | 20 74 68 65 0d 23 20 53 |under in| the.# S|
|000006d0| 74 61 72 74 55 70 20 49 | 74 65 6d 73 20 66 6f 6c |tartUp I|tems fol|
|000006e0| 64 65 72 20 69 6e 20 74 | 68 65 20 73 79 73 74 65 |der in t|he syste|
|000006f0| 6d 20 66 6f 6c 64 65 72 | 2e 20 20 54 68 69 73 20 |m folder|. This |
|00000700| 77 69 6c 6c 20 69 6e 73 | 75 72 65 20 74 68 61 74 |will ins|ure that|
|00000710| 0d 23 20 69 74 20 69 73 | 20 61 6c 77 61 79 73 20 |.# it is| always |
|00000720| 6c 61 75 6e 63 68 65 64 | 2c 20 61 6e 64 20 69 74 |launched|, and it|
|00000730| 20 77 69 6c 6c 20 61 6c | 73 6f 20 72 65 64 75 63 | will al|so reduc|
|00000740| 65 20 6d 65 6d 6f 72 79 | 20 66 72 61 67 6d 65 6e |e memory| fragmen|
|00000750| 74 61 74 69 6f 6e 0d 23 | 20 73 69 6e 63 65 20 69 |tation.#| since i|
|00000760| 74 20 77 69 6c 6c 20 62 | 65 20 69 6e 73 74 61 6c |t will b|e instal|
|00000770| 6c 65 64 20 61 74 20 73 | 74 61 72 74 75 70 20 74 |led at s|tartup t|
|00000780| 69 6d 65 2e 20 20 59 6f | 75 20 63 61 6e 20 73 65 |ime. Yo|u can se|
|00000790| 61 72 63 68 20 66 6f 72 | 20 69 74 0d 23 20 77 68 |arch for| it.# wh|
|000007a0| 65 6e 20 79 6f 75 20 6e | 65 65 64 20 69 74 20 77 |en you n|eed it w|
|000007b0| 69 74 68 20 49 50 43 4c | 69 73 74 50 6f 72 74 73 |ith IPCL|istPorts|
|000007c0| 20 28 73 65 65 20 74 68 | 65 20 50 50 43 20 74 6f | (see th|e PPC to|
|000007d0| 6f 6c 62 6f 78 20 64 6f | 63 75 6d 65 6e 74 61 74 |olbox do|cumentat|
|000007e0| 69 6f 6e 29 2e 0d 23 20 | 4f 70 74 69 6f 6e 61 6c |ion)..# |Optional|
|000007f0| 6c 79 2c 20 79 6f 75 20 | 63 61 6e 20 75 73 65 20 |ly, you |can use |
|00000800| 74 68 65 20 4c 61 75 6e | 63 68 41 70 70 6c 69 63 |the Laun|chApplic|
|00000810| 61 74 69 6f 6e 20 74 72 | 61 70 20 74 6f 20 6c 61 |ation tr|ap to la|
|00000820| 75 6e 63 68 20 69 74 20 | 0d 23 20 77 68 65 6e 20 |unch it |.# when |
|00000830| 79 6f 75 20 6e 65 65 64 | 20 69 74 2c 20 61 6e 64 |you need| it, and|
|00000840| 20 6b 69 6c 6c 20 69 74 | 20 77 68 65 6e 20 79 6f | kill it| when yo|
|00000850| 75 27 72 65 20 64 6f 6e | 65 2e 20 20 42 75 74 20 |u're don|e. But |
|00000860| 74 68 69 73 20 63 6f 75 | 6c 64 20 0d 23 20 63 61 |this cou|ld .# ca|
|00000870| 75 73 65 20 73 6f 6d 65 | 20 6d 75 6c 74 69 46 69 |use some| multiFi|
|00000880| 6e 64 65 72 20 68 65 61 | 70 20 66 72 61 67 6d 65 |nder hea|p fragme|
|00000890| 6e 74 61 74 69 6f 6e 2e | 0d 23 0d 23 20 41 6e 64 |ntation.|.#.# And|
|000008a0| 20 72 65 6d 65 6d 62 65 | 72 2c 20 69 74 27 73 20 | remembe|r, it's |
|000008b0| 61 20 62 61 63 6b 67 72 | 6f 75 6e 64 65 72 2c 20 |a backgr|ounder, |
|000008c0| 79 6f 75 20 63 61 6e 27 | 74 20 73 65 65 20 69 74 |you can'|t see it|
|000008d0| 2e 20 20 54 6f 20 6b 69 | 6c 6c 20 69 74 0d 23 20 |. To ki|ll it.# |
|000008e0| 75 73 65 20 54 61 73 6b | 49 74 20 6f 72 20 50 72 |use Task|It or Pr|
|000008f0| 6f 63 44 6f 67 67 69 65 | 2e 0d 23 0d 23 20 2d 2d |ocDoggie|..#.# --|
|00000900| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000910| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000920| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000930| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 0d 23 20 |--------|-----.# |
|00000940| 20 20 55 73 65 20 74 68 | 69 73 20 73 61 6d 70 6c | Use th|is sampl|
|00000950| 65 20 61 73 20 61 20 73 | 74 61 72 74 69 6e 67 20 |e as a s|tarting |
|00000960| 70 6f 69 6e 74 2c 20 61 | 6e 64 20 61 64 61 70 74 |point, a|nd adapt|
|00000970| 20 69 74 73 27 20 72 6f | 75 74 69 6e 65 73 20 74 | its' ro|utines t|
|00000980| 6f 20 0d 23 20 20 20 6d | 65 65 74 20 74 68 65 20 |o .# m|eet the |
|00000990| 73 70 65 63 69 66 69 63 | 20 6e 65 65 64 73 20 6f |specific| needs o|
|000009a0| 66 20 79 6f 75 72 20 70 | 72 6f 6a 65 63 74 2e 20 |f your p|roject. |
|000009b0| 20 0d 23 0d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d | .#.----|--------|
|000009c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000009d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000009e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000009f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000a00| 2d 2d 2a 2f 0d 0d 2f 2a | 20 54 68 69 73 20 64 6f |--*/../*| This do|
|00000a10| 65 73 6e 27 74 20 64 6f | 20 6d 75 63 68 20 62 75 |esn't do| much bu|
|00000a20| 74 20 77 61 69 74 20 66 | 6f 72 20 61 20 71 75 69 |t wait f|or a qui|
|00000a30| 74 20 65 76 65 6e 74 2e | 20 20 42 75 74 2c 20 79 |t event.| But, y|
|00000a40| 6f 75 20 63 61 6e 20 65 | 78 70 61 6e 64 20 69 74 |ou can e|xpand it|
|00000a50| 20 2a 2f 0d 2f 2a 20 74 | 6f 20 73 75 69 74 20 77 | */./* t|o suit w|
|00000a60| 68 61 74 65 76 65 72 20 | 79 6f 75 72 20 6e 65 65 |hatever |your nee|
|00000a70| 64 73 20 61 72 65 20 66 | 6f 72 20 61 20 62 61 63 |ds are f|or a bac|
|00000a80| 6b 67 72 6f 75 6e 64 65 | 72 2e 20 20 2a 2f 0d 2f |kgrounde|r. */./|
|00000a90| 2a 20 42 65 20 73 75 72 | 65 20 74 6f 20 6c 6f 6f |* Be sur|e to loo|
|00000aa0| 6b 20 61 74 20 74 68 65 | 20 53 49 5a 45 20 72 65 |k at the| SIZE re|
|00000ab0| 73 6f 75 72 63 65 20 66 | 6f 72 20 74 68 69 73 20 |source f|or this |
|00000ac0| 61 70 70 20 74 6f 20 73 | 65 65 20 68 6f 77 20 74 |app to s|ee how t|
|00000ad0| 68 65 20 2a 2f 0d 2f 2a | 20 66 6c 61 67 73 20 73 |he */./*| flags s|
|00000ae0| 68 6f 75 6c 64 20 62 65 | 20 73 65 74 20 66 6f 72 |hould be| set for|
|00000af0| 20 61 20 62 61 63 6b 67 | 72 6f 75 6e 64 2d 6f 6e | a backg|round-on|
|00000b00| 6c 79 20 74 61 73 6b 20 | 2a 2f 0d 23 69 6e 63 6c |ly task |*/.#incl|
|00000b10| 75 64 65 20 3c 6d 65 6d | 6f 72 79 2e 68 3e 0d 23 |ude <mem|ory.h>.#|
|00000b20| 69 6e 63 6c 75 64 65 20 | 3c 61 70 70 6c 65 65 76 |include |<appleev|
|00000b30| 65 6e 74 73 2e 68 3e 0d | 23 69 6e 63 6c 75 64 65 |ents.h>.|#include|
|00000b40| 20 3c 65 76 65 6e 74 73 | 2e 68 3e 0d 23 69 6e 63 | <events|.h>.#inc|
|00000b50| 6c 75 64 65 20 3c 74 79 | 70 65 73 2e 68 3e 0d 23 |lude <ty|pes.h>.#|
|00000b60| 69 6e 63 6c 75 64 65 20 | 3c 67 65 73 74 61 6c 74 |include |<gestalt|
|00000b70| 65 71 75 2e 68 3e 0d 23 | 69 6e 63 6c 75 64 65 20 |equ.h>.#|include |
|00000b80| 22 70 62 2e 68 22 0d 0d | 2f 2a 20 76 61 72 69 61 |"pb.h"..|/* varia|
|00000b90| 62 6c 65 73 20 2a 2f 0d | 42 6f 6f 6c 65 61 6e 20 |bles */.|Boolean |
|00000ba0| 67 51 75 69 74 20 3d 20 | 66 61 6c 73 65 3b 0d 45 |gQuit = |false;.E|
|00000bb0| 76 65 6e 74 52 65 63 6f | 72 64 20 67 45 52 65 63 |ventReco|rd gERec|
|00000bc0| 6f 72 64 3b 0d 42 6f 6f | 6c 65 61 6e 20 67 48 61 |ord;.Boo|lean gHa|
|00000bd0| 73 41 70 70 6c 65 45 76 | 65 6e 74 73 3b 0d 75 6e |sAppleEv|ents;.un|
|00000be0| 73 69 67 6e 65 64 20 6c | 6f 6e 67 20 67 4d 79 53 |signed l|ong gMyS|
|00000bf0| 6c 65 65 70 20 3d 20 31 | 32 30 3b 20 20 2f 2a 20 |leep = 1|20; /* |
|00000c00| 6c 6f 6e 67 20 74 69 6d | 65 2c 20 6c 6f 6e 67 20 |long tim|e, long |
|00000c10| 74 69 6d 65 2e 20 20 43 | 68 61 6e 67 65 20 74 68 |time. C|hange th|
|00000c20| 69 73 20 69 66 20 20 2a | 2f 0d 2f 2a 20 79 6f 75 |is if *|/./* you|
|00000c30| 27 64 20 6c 69 6b 65 20 | 74 6f 20 64 6f 20 6e 75 |'d like |to do nu|
|00000c40| 6c 6c 20 70 72 6f 63 65 | 73 73 69 6e 67 2e 20 4a |ll proce|ssing. J|
|00000c50| 75 73 74 20 6b 65 65 70 | 20 69 6e 20 6d 69 6e 64 |ust keep| in mind|
|00000c60| 20 74 68 61 74 20 74 68 | 65 20 2a 2f 0d 2f 2a 20 | that th|e */./* |
|00000c70| 75 73 65 72 20 64 6f 65 | 73 20 4e 4f 54 20 6b 6e |user doe|s NOT kn|
|00000c80| 6f 77 20 74 68 61 74 20 | 79 6f 75 20 65 78 69 73 |ow that |you exis|
|00000c90| 74 2c 20 61 6e 64 20 69 | 66 20 79 6f 75 20 61 72 |t, and i|f you ar|
|00000ca0| 65 20 65 61 74 69 6e 67 | 20 2a 2f 0d 2f 2a 20 75 |e eating| */./* u|
|00000cb0| 70 20 61 20 62 75 6e 63 | 68 20 6f 66 20 74 69 6d |p a bunc|h of tim|
|00000cc0| 65 20 74 68 65 20 75 73 | 65 72 20 77 69 6c 6c 20 |e the us|er will |
|00000cd0| 6e 6f 74 20 6b 6e 6f 77 | 20 77 68 79 20 68 69 73 |not know| why his|
|00000ce0| 20 6f 72 20 68 65 72 20 | 2a 2f 0d 2f 2a 20 6d 61 | or her |*/./* ma|
|00000cf0| 63 68 69 6e 65 20 69 73 | 20 73 6c 6f 77 69 6e 67 |chine is| slowing|
|00000d00| 20 64 6f 77 6e 2e 20 2a | 2f 0d 0d 2f 2a 20 73 74 | down. *|/../* st|
|00000d10| 72 75 63 74 73 20 2a 2f | 0d 2f 2a 20 61 20 6c 69 |ructs */|./* a li|
|00000d20| 74 74 6c 65 20 73 74 72 | 75 63 74 20 74 6f 20 69 |ttle str|uct to i|
|00000d30| 6e 73 74 61 6c 6c 20 68 | 61 6e 64 6c 65 72 73 20 |nstall h|andlers |
|00000d40| 66 72 6f 6d 2e 20 20 4d | 61 6b 65 73 20 69 74 20 |from. M|akes it |
|00000d50| 65 61 73 69 65 72 20 74 | 6f 20 70 6c 75 67 20 69 |easier t|o plug i|
|00000d60| 6e 20 2a 2f 0d 2f 2a 20 | 6e 65 77 20 68 61 6e 64 |n */./* |new hand|
|00000d70| 6c 65 72 73 20 2a 2f 0d | 73 74 72 75 63 74 20 41 |lers */.|struct A|
|00000d80| 45 69 6e 73 74 61 6c 6c | 73 20 7b 0d 20 20 20 20 |Einstall|s {. |
|00000d90| 41 45 45 76 65 6e 74 43 | 6c 61 73 73 20 74 68 65 |AEEventC|lass the|
|00000da0| 43 6c 61 73 73 3b 0d 20 | 20 20 20 41 45 45 76 65 |Class;. | AEEve|
|00000db0| 6e 74 49 44 20 74 68 65 | 45 76 65 6e 74 3b 0d 20 |ntID the|Event;. |
|00000dc0| 20 20 20 45 76 65 6e 74 | 48 61 6e 64 6c 65 72 50 | Event|HandlerP|
|00000dd0| 72 6f 63 50 74 72 20 74 | 68 65 50 72 6f 63 3b 0d |rocPtr t|heProc;.|
|00000de0| 7d 3b 0d 74 79 70 65 64 | 65 66 20 73 74 72 75 63 |};.typed|ef struc|
|00000df0| 74 20 41 45 69 6e 73 74 | 61 6c 6c 73 20 41 45 69 |t AEinst|alls AEi|
|00000e00| 6e 73 74 61 6c 6c 73 3b | 0d 0d 2f 2a 20 70 72 6f |nstalls;|../* pro|
|00000e10| 74 6f 74 79 70 65 73 20 | 66 6f 72 20 74 68 69 73 |totypes |for this|
|00000e20| 20 66 69 6c 65 20 2a 2f | 0d 70 61 73 63 61 6c 20 | file */|.pascal |
|00000e30| 4f 53 45 72 72 20 41 45 | 4f 70 65 6e 48 61 6e 64 |OSErr AE|OpenHand|
|00000e40| 6c 65 72 28 41 70 70 6c | 65 45 76 65 6e 74 20 2a |ler(Appl|eEvent *|
|00000e50| 6d 65 73 73 61 67 65 69 | 6e 2c 20 41 70 70 6c 65 |messagei|n, Apple|
|00000e60| 45 76 65 6e 74 20 2a 72 | 65 70 6c 79 2c 20 6c 6f |Event *r|eply, lo|
|00000e70| 6e 67 20 72 65 66 49 6e | 29 3b 0d 70 61 73 63 61 |ng refIn|);.pasca|
|00000e80| 6c 20 4f 53 45 72 72 20 | 41 45 4f 70 65 6e 44 6f |l OSErr |AEOpenDo|
|00000e90| 63 48 61 6e 64 6c 65 72 | 28 41 70 70 6c 65 45 76 |cHandler|(AppleEv|
|00000ea0| 65 6e 74 20 2a 6d 65 73 | 73 61 67 65 69 6e 2c 20 |ent *mes|sagein, |
|00000eb0| 41 70 70 6c 65 45 76 65 | 6e 74 20 2a 72 65 70 6c |AppleEve|nt *repl|
|00000ec0| 79 2c 20 6c 6f 6e 67 20 | 72 65 66 49 6e 29 3b 0d |y, long |refIn);.|
|00000ed0| 70 61 73 63 61 6c 20 4f | 53 45 72 72 20 41 45 50 |pascal O|SErr AEP|
|00000ee0| 72 69 6e 74 48 61 6e 64 | 6c 65 72 28 41 70 70 6c |rintHand|ler(Appl|
|00000ef0| 65 45 76 65 6e 74 20 2a | 6d 65 73 73 61 67 65 69 |eEvent *|messagei|
|00000f00| 6e 2c 20 41 70 70 6c 65 | 45 76 65 6e 74 20 2a 72 |n, Apple|Event *r|
|00000f10| 65 70 6c 79 2c 20 6c 6f | 6e 67 20 72 65 66 49 6e |eply, lo|ng refIn|
|00000f20| 29 3b 0d 70 61 73 63 61 | 6c 20 4f 53 45 72 72 20 |);.pasca|l OSErr |
|00000f30| 41 45 51 75 69 74 48 61 | 6e 64 6c 65 72 28 41 70 |AEQuitHa|ndler(Ap|
|00000f40| 70 6c 65 45 76 65 6e 74 | 20 2a 6d 65 73 73 61 67 |pleEvent| *messag|
|00000f50| 65 69 6e 2c 20 41 70 70 | 6c 65 45 76 65 6e 74 20 |ein, App|leEvent |
|00000f60| 2a 72 65 70 6c 79 2c 20 | 6c 6f 6e 67 20 72 65 66 |*reply, |long ref|
|00000f70| 49 6e 29 3b 0d 76 6f 69 | 64 20 44 6f 48 69 67 68 |In);.voi|d DoHigh|
|00000f80| 4c 65 76 65 6c 28 45 76 | 65 6e 74 52 65 63 6f 72 |Level(Ev|entRecor|
|00000f90| 64 20 2a 41 45 52 65 63 | 6f 72 64 29 3b 0d 76 6f |d *AERec|ord);.vo|
|00000fa0| 69 64 20 49 6e 69 74 41 | 45 53 74 75 66 66 28 76 |id InitA|EStuff(v|
|00000fb0| 6f 69 64 29 3b 0d 0d 6d | 61 69 6e 28 29 0d 7b 0d |oid);..m|ain().{.|
|00000fc0| 20 20 20 20 2f 2a 20 57 | 65 20 61 72 65 20 4e 4f | /* W|e are NO|
|00000fd0| 54 20 69 6e 69 74 69 61 | 6c 69 7a 69 6e 67 20 61 |T initia|lizing a|
|00000fe0| 6e 79 20 6d 61 6e 61 67 | 65 72 73 2e 20 20 57 65 |ny manag|ers. We|
|00000ff0| 27 72 65 20 69 6e 20 74 | 68 65 20 62 61 63 6b 67 |'re in t|he backg|
|00001000| 72 6f 75 6e 64 2c 20 77 | 69 74 68 20 6e 6f 20 2a |round, w|ith no *|
|00001010| 2f 0d 20 20 20 20 2f 2a | 20 66 61 63 65 2c 20 77 |/. /*| face, w|
|00001020| 65 20 63 61 6e 27 74 20 | 75 73 65 20 77 69 6e 64 |e can't |use wind|
|00001030| 6f 77 73 20 6f 72 20 64 | 69 61 6c 6f 67 73 20 6f |ows or d|ialogs o|
|00001040| 72 20 6d 65 6e 75 73 2e | 20 20 49 66 20 79 6f 75 |r menus.| If you|
|00001050| 20 6e 65 65 64 20 74 6f | 20 74 61 6c 6b 20 74 6f | need to| talk to|
|00001060| 20 74 68 65 20 2a 2f 0d | 20 20 20 20 2f 2a 20 75 | the */.| /* u|
|00001070| 73 65 72 20 79 6f 75 20 | 63 61 6e 20 70 6f 73 74 |ser you |can post|
|00001080| 20 61 20 6e 6f 74 69 66 | 69 63 61 74 69 6f 6e 2c | a notif|ication,|
|00001090| 20 6f 72 20 6c 61 75 6e | 63 68 20 61 6e 20 61 70 | or laun|ch an ap|
|000010a0| 70 6c 69 63 61 74 69 6f | 6e 20 74 6f 20 63 6f 6d |plicatio|n to com|
|000010b0| 6d 75 6e 69 63 61 74 65 | 20 2a 2f 0d 20 20 20 20 |municate| */. |
|000010c0| 2f 2a 20 50 61 73 73 69 | 6e 67 20 61 6e 20 41 70 |/* Passi|ng an Ap|
|000010d0| 70 6c 65 45 76 65 6e 74 | 20 69 6e 20 74 68 65 20 |pleEvent| in the |
|000010e0| 6c 61 75 6e 63 68 61 70 | 70 6c 69 63 61 74 69 6f |launchap|plicatio|
|000010f0| 6e 20 74 72 61 70 20 63 | 6f 75 6c 64 20 64 6f 20 |n trap c|ould do |
|00001100| 74 68 65 20 2a 2f 0d 20 | 20 20 20 2f 2a 20 63 6f |the */. | /* co|
|00001110| 6d 6d 75 6e 69 63 61 74 | 69 6f 6e 20 66 6f 72 20 |mmunicat|ion for |
|00001120| 79 6f 75 2e 20 2a 2f 0d | 09 0d 09 49 6e 69 74 47 |you. */.|...InitG|
|00001130| 72 61 66 28 28 50 74 72 | 29 20 26 74 68 65 50 6f |raf((Ptr|) &thePo|
|00001140| 72 74 29 3b 0d 09 2f 2a | 20 52 6f 75 74 69 6e 65 |rt);../*| Routine|
|00001150| 20 74 6f 20 69 6e 73 74 | 61 6c 6c 20 41 70 70 6c | to inst|all Appl|
|00001160| 65 20 65 76 65 6e 74 20 | 68 61 6e 64 6c 65 72 73 |e event |handlers|
|00001170| 20 2a 2f 0d 20 20 20 20 | 49 6e 69 74 41 45 53 74 | */. |InitAESt|
|00001180| 75 66 66 28 29 3b 0d 20 | 20 20 20 0d 20 20 20 20 |uff();. | . |
|00001190| 49 6e 69 74 50 6f 72 74 | 61 62 6c 65 53 74 75 66 |InitPort|ableStuf|
|000011a0| 66 28 29 3b 0d 0d 20 20 | 20 20 2f 2a 20 6e 6f 20 |f();.. | /* no |
|000011b0| 6e 6f 74 68 69 6e 67 20 | 62 75 74 20 68 69 67 68 |nothing |but high|
|000011c0| 20 6c 65 76 65 6c 20 65 | 76 65 6e 74 73 20 2a 2f | level e|vents */|
|000011d0| 0d 20 20 20 20 77 68 69 | 6c 65 20 28 67 51 75 69 |. whi|le (gQui|
|000011e0| 74 20 3d 3d 20 66 61 6c | 73 65 29 20 7b 0d 20 20 |t == fal|se) {. |
|000011f0| 20 20 20 20 20 20 57 61 | 69 74 4e 65 78 74 45 76 | Wa|itNextEv|
|00001200| 65 6e 74 28 68 69 67 68 | 4c 65 76 65 6c 45 76 65 |ent(high|LevelEve|
|00001210| 6e 74 4d 61 73 6b 2c 20 | 26 67 45 52 65 63 6f 72 |ntMask, |&gERecor|
|00001220| 64 2c 20 67 4d 79 53 6c | 65 65 70 2c 20 30 29 3b |d, gMySl|eep, 0);|
|00001230| 0d 09 09 43 68 65 63 6b | 46 6f 72 4d 61 69 6e 73 |...Check|ForMains|
|00001240| 28 29 3b 0d 09 09 73 77 | 69 74 63 68 20 28 67 45 |();...sw|itch (gE|
|00001250| 52 65 63 6f 72 64 2e 77 | 68 61 74 29 20 7b 09 09 |Record.w|hat) {..|
|00001260| 09 09 09 0d 09 09 09 63 | 61 73 65 20 6b 48 69 67 |.......c|ase kHig|
|00001270| 68 4c 65 76 65 6c 45 76 | 65 6e 74 3a 0d 09 09 09 |hLevelEv|ent:....|
|00001280| 44 6f 48 69 67 68 4c 65 | 76 65 6c 28 26 67 45 52 |DoHighLe|vel(&gER|
|00001290| 65 63 6f 72 64 29 3b 0d | 09 09 09 62 72 65 61 6b |ecord);.|...break|
|000012a0| 3b 0d 20 20 20 20 20 20 | 20 20 7d 0d 20 20 20 20 |;. | }. |
|000012b0| 7d 0d 7d 0d 0d 2f 2a 20 | 48 65 72 65 20 61 72 65 |}.}../* |Here are|
|000012c0| 20 74 68 65 20 41 70 70 | 6c 65 45 76 65 6e 74 20 | the App|leEvent |
|000012d0| 68 61 6e 64 6c 65 72 73 | 20 66 6f 72 20 74 68 69 |handlers| for thi|
|000012e0| 73 20 62 61 63 6b 67 72 | 6f 75 6e 64 2d 6f 6e 6c |s backgr|ound-onl|
|000012f0| 79 20 74 61 73 6b 2e 20 | 2a 2f 0d 2f 2a 20 53 69 |y task. |*/./* Si|
|00001300| 6e 63 65 20 74 68 69 73 | 20 69 73 20 61 20 72 65 |nce this| is a re|
|00001310| 61 6c 20 6c 69 76 65 20 | 61 70 70 6c 69 63 61 74 |al live |applicat|
|00001320| 69 6f 6e 2c 20 69 74 20 | 63 61 6e 20 61 63 63 65 |ion, it |can acce|
|00001330| 70 74 20 61 6e 64 20 73 | 65 6e 64 20 61 6e 79 20 |pt and s|end any |
|00001340| 2a 2f 0d 2f 2a 20 41 70 | 70 6c 65 20 45 76 65 6e |*/./* Ap|ple Even|
|00001350| 74 73 20 79 6f 75 20 77 | 61 6e 74 20 74 6f 20 73 |ts you w|ant to s|
|00001360| 65 6e 64 20 6f 72 20 72 | 65 63 65 69 76 65 2e 20 |end or r|eceive. |
|00001370| 20 2a 2f 0d 2f 2a 20 49 | 6e 20 74 68 69 73 20 63 | */./* I|n this c|
|00001380| 61 73 65 2c 20 74 68 65 | 20 6f 6e 6c 79 20 6f 6e |ase, the| only on|
|00001390| 65 73 20 74 68 61 74 20 | 6d 61 6b 65 20 61 6e 79 |es that |make any|
|000013a0| 20 73 65 6e 73 65 20 69 | 6e 20 74 68 69 73 20 61 | sense i|n this a|
|000013b0| 70 70 20 61 72 65 20 2a | 2f 0d 2f 2a 20 27 6f 61 |pp are *|/./* 'oa|
|000013c0| 70 70 27 20 61 6e 64 20 | 27 71 75 69 74 27 20 2a |pp' and |'quit' *|
|000013d0| 2f 0d 0d 0d 2f 2a 20 49 | 6e 69 74 41 45 53 74 75 |/.../* I|nitAEStu|
|000013e0| 66 66 20 63 68 65 63 6b | 73 20 66 6f 72 20 74 68 |ff check|s for th|
|000013f0| 65 20 61 76 61 69 6c 61 | 62 69 6c 69 74 79 20 6f |e availa|bility o|
|00001400| 66 20 74 68 65 20 41 70 | 70 6c 65 45 76 65 6e 74 |f the Ap|pleEvent|
|00001410| 20 4d 61 6e 61 67 65 72 | 20 61 6e 64 20 2a 2f 0d | Manager| and */.|
|00001420| 2f 2a 20 69 6e 73 74 61 | 6c 6c 73 20 6f 75 72 20 |/* insta|lls our |
|00001430| 65 76 65 6e 74 20 68 61 | 6e 64 6c 65 72 73 2e 20 |event ha|ndlers. |
|00001440| 2a 2f 0d 2f 2a 20 69 66 | 20 74 68 65 20 41 45 4d |*/./* if| the AEM|
|00001450| 20 69 73 6e 27 74 20 61 | 72 6f 75 6e 64 2c 20 77 | isn't a|round, w|
|00001460| 65 20 62 61 69 6c 2e 20 | 2a 2f 0d 76 6f 69 64 20 |e bail. |*/.void |
|00001470| 49 6e 69 74 41 45 53 74 | 75 66 66 28 76 6f 69 64 |InitAESt|uff(void|
|00001480| 29 0d 7b 0d 20 20 20 20 | 73 74 61 74 69 63 20 41 |).{. |static A|
|00001490| 45 69 6e 73 74 61 6c 6c | 73 20 48 61 6e 64 6c 65 |Einstall|s Handle|
|000014a0| 72 73 54 6f 49 6e 73 74 | 61 6c 6c 5b 5d 20 3d 20 |rsToInst|all[] = |
|000014b0| 20 7b 0d 20 20 20 20 20 | 20 20 20 20 7b 0d 20 20 | {. | {. |
|000014c0| 20 20 20 20 20 20 20 20 | 20 20 6b 43 6f 72 65 45 | | kCoreE|
|000014d0| 76 65 6e 74 43 6c 61 73 | 73 2c 20 6b 41 45 4f 70 |ventClas|s, kAEOp|
|000014e0| 65 6e 41 70 70 6c 69 63 | 61 74 69 6f 6e 2c 20 41 |enApplic|ation, A|
|000014f0| 45 4f 70 65 6e 48 61 6e | 64 6c 65 72 0d 20 20 20 |EOpenHan|dler. |
|00001500| 20 20 20 20 20 7d 2c 20 | 20 7b 0d 20 20 20 20 20 | }, | {. |
|00001510| 20 20 20 20 20 20 20 6b | 43 6f 72 65 45 76 65 6e | k|CoreEven|
|00001520| 74 43 6c 61 73 73 2c 20 | 6b 41 45 4f 70 65 6e 44 |tClass, |kAEOpenD|
|00001530| 6f 63 75 6d 65 6e 74 73 | 2c 20 41 45 4f 70 65 6e |ocuments|, AEOpen|
|00001540| 44 6f 63 48 61 6e 64 6c | 65 72 0d 20 20 20 20 20 |DocHandl|er. |
|00001550| 20 20 20 7d 2c 20 20 7b | 0d 20 20 20 20 20 20 20 | }, {|. |
|00001560| 20 20 20 20 20 6b 43 6f | 72 65 45 76 65 6e 74 43 | kCo|reEventC|
|00001570| 6c 61 73 73 2c 20 6b 41 | 45 51 75 69 74 41 70 70 |lass, kA|EQuitApp|
|00001580| 6c 69 63 61 74 69 6f 6e | 2c 20 41 45 51 75 69 74 |lication|, AEQuit|
|00001590| 48 61 6e 64 6c 65 72 0d | 20 20 20 20 20 20 20 20 |Handler.| |
|000015a0| 7d 2c 20 20 7b 0d 20 20 | 20 20 20 20 20 20 20 20 |}, {. | |
|000015b0| 20 20 6b 43 6f 72 65 45 | 76 65 6e 74 43 6c 61 73 | kCoreE|ventClas|
|000015c0| 73 2c 20 6b 41 45 50 72 | 69 6e 74 44 6f 63 75 6d |s, kAEPr|intDocum|
|000015d0| 65 6e 74 73 2c 20 41 45 | 50 72 69 6e 74 48 61 6e |ents, AE|PrintHan|
|000015e0| 64 6c 65 72 0d 20 20 20 | 20 20 20 20 20 7d 2c 20 |dler. | }, |
|000015f0| 0d 20 20 20 20 20 20 20 | 20 2f 2a 20 54 68 65 20 |. | /* The |
|00001600| 61 62 6f 76 65 20 61 72 | 65 20 74 68 65 20 66 6f |above ar|e the fo|
|00001610| 75 72 20 72 65 71 75 69 | 72 65 64 20 41 70 70 6c |ur requi|red Appl|
|00001620| 65 45 76 65 6e 74 73 2e | 20 2a 2f 0d 20 20 20 20 |eEvents.| */. |
|00001630| 7d 3b 0d 20 20 20 20 0d | 20 20 20 20 4f 53 45 72 |};. .| OSEr|
|00001640| 72 20 61 65 76 74 45 72 | 72 20 3d 20 6e 6f 45 72 |r aevtEr|r = noEr|
|00001650| 72 3b 0d 20 20 20 20 6c | 6f 6e 67 20 61 4c 6f 6e |r;. l|ong aLon|
|00001660| 67 20 3d 20 30 3b 0d 20 | 20 20 20 42 6f 6f 6c 65 |g = 0;. | Boole|
|00001670| 61 6e 20 67 48 61 73 41 | 70 70 6c 65 45 76 65 6e |an gHasA|ppleEven|
|00001680| 74 73 20 3d 20 66 61 6c | 73 65 3b 0d 20 20 20 20 |ts = fal|se;. |
|00001690| 2f 2a 20 43 68 65 63 6b | 20 74 68 69 73 20 6d 61 |/* Check| this ma|
|000016a0| 63 68 69 6e 65 20 66 6f | 72 20 41 70 70 6c 65 45 |chine fo|r AppleE|
|000016b0| 76 65 6e 74 73 2e 20 20 | 49 66 20 74 68 65 79 20 |vents. |If they |
|000016c0| 61 72 65 20 6e 6f 74 20 | 68 65 72 65 20 28 69 65 |are not |here (ie|
|000016d0| 20 6e 6f 74 20 37 2e 30 | 29 0d 20 20 20 20 2a 20 | not 7.0|). * |
|000016e0| 20 20 74 68 65 6e 20 77 | 65 20 65 78 69 74 20 2a | then w|e exit *|
|000016f0| 2f 0d 20 20 20 20 67 48 | 61 73 41 70 70 6c 65 45 |/. gH|asAppleE|
|00001700| 76 65 6e 74 73 20 3d 20 | 28 47 65 73 74 61 6c 74 |vents = |(Gestalt|
|00001710| 28 67 65 73 74 61 6c 74 | 41 70 70 6c 65 45 76 65 |(gestalt|AppleEve|
|00001720| 6e 74 73 41 74 74 72 2c | 20 26 61 4c 6f 6e 67 29 |ntsAttr,| &aLong)|
|00001730| 20 3d 3d 20 6e 6f 45 72 | 72 29 3b 0d 20 20 20 20 | == noEr|r);. |
|00001740| 2f 2a 20 54 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |/* The f|ollowing|
|00001750| 20 73 65 72 69 65 73 20 | 6f 66 20 63 61 6c 6c 73 | series |of calls|
|00001760| 20 69 6e 73 74 61 6c 6c | 73 20 61 6c 6c 20 6f 75 | install|s all ou|
|00001770| 72 20 41 70 70 6c 65 45 | 76 65 6e 74 20 48 61 6e |r AppleE|vent Han|
|00001780| 64 6c 65 72 73 2e 0d 20 | 20 20 20 2a 20 20 20 54 |dlers.. | * T|
|00001790| 68 65 73 65 20 68 61 6e | 64 6c 65 72 73 20 61 72 |hese han|dlers ar|
|000017a0| 65 20 61 64 64 65 64 20 | 74 6f 20 74 68 65 20 61 |e added |to the a|
|000017b0| 70 70 6c 69 63 61 74 69 | 6f 6e 20 65 76 65 6e 74 |pplicati|on event|
|000017c0| 20 68 61 6e 64 6c 65 72 | 20 6c 69 73 74 20 74 68 | handler| list th|
|000017d0| 61 74 20 0d 20 20 20 20 | 2a 20 20 20 74 68 65 20 |at . |* the |
|000017e0| 41 70 70 6c 65 45 76 65 | 6e 74 20 6d 61 6e 61 67 |AppleEve|nt manag|
|000017f0| 65 72 20 6d 61 69 6e 74 | 61 69 6e 73 2e 20 20 53 |er maint|ains. S|
|00001800| 6f 2c 20 77 68 65 6e 65 | 76 65 72 20 61 6e 20 41 |o, whene|ver an A|
|00001810| 70 70 6c 65 45 76 65 6e | 74 20 68 61 70 70 65 6e |ppleEven|t happen|
|00001820| 73 0d 20 20 20 20 2a 20 | 20 20 61 6e 64 20 77 65 |s. * | and we|
|00001830| 20 63 61 6c 6c 20 41 45 | 50 72 6f 63 65 73 73 45 | call AE|ProcessE|
|00001840| 76 65 6e 74 2c 20 74 68 | 65 20 41 70 70 6c 65 45 |vent, th|e AppleE|
|00001850| 76 65 6e 74 20 6d 61 6e | 61 67 65 72 20 77 69 6c |vent man|ager wil|
|00001860| 6c 20 63 68 65 63 6b 20 | 6f 75 72 0d 20 20 20 20 |l check |our. |
|00001870| 2a 20 20 20 6c 69 73 74 | 20 6f 66 20 68 61 6e 64 |* list| of hand|
|00001880| 6c 65 72 73 20 61 6e 64 | 20 64 69 73 70 61 74 63 |lers and| dispatc|
|00001890| 68 20 74 6f 20 69 74 20 | 69 66 20 74 68 65 72 65 |h to it |if there|
|000018a0| 20 69 73 20 6f 6e 65 2e | 0d 20 20 20 20 2a 2f 0d | is one.|. */.|
|000018b0| 20 20 20 20 69 66 20 28 | 67 48 61 73 41 70 70 6c | if (|gHasAppl|
|000018c0| 65 45 76 65 6e 74 73 29 | 20 7b 0d 20 20 20 20 20 |eEvents)| {. |
|000018d0| 20 20 20 72 65 67 69 73 | 74 65 72 20 71 71 3b 0d | regis|ter qq;.|
|000018e0| 20 20 20 20 20 20 20 20 | 66 6f 72 20 28 71 71 20 | |for (qq |
|000018f0| 3d 20 30 3b 20 71 71 20 | 3c 20 28 28 73 69 7a 65 |= 0; qq |< ((size|
|00001900| 6f 66 28 48 61 6e 64 6c | 65 72 73 54 6f 49 6e 73 |of(Handl|ersToIns|
|00001910| 74 61 6c 6c 29 20 2f 20 | 73 69 7a 65 6f 66 28 41 |tall) / |sizeof(A|
|00001920| 45 69 6e 73 74 61 6c 6c | 73 29 29 29 3b 20 71 71 |Einstall|s))); qq|
|00001930| 2b 2b 29 20 7b 0d 20 20 | 20 20 20 20 20 20 20 20 |++) {. | |
|00001940| 20 20 61 65 76 74 45 72 | 72 20 3d 20 41 45 49 6e | aevtEr|r = AEIn|
|00001950| 73 74 61 6c 6c 45 76 65 | 6e 74 48 61 6e 64 6c 65 |stallEve|ntHandle|
|00001960| 72 28 48 61 6e 64 6c 65 | 72 73 54 6f 49 6e 73 74 |r(Handle|rsToInst|
|00001970| 61 6c 6c 5b 71 71 5d 2e | 74 68 65 43 6c 61 73 73 |all[qq].|theClass|
|00001980| 2c 20 48 61 6e 64 6c 65 | 72 73 54 6f 49 6e 73 74 |, Handle|rsToInst|
|00001990| 61 6c 6c 5b 71 71 5d 2e | 74 68 65 45 76 65 6e 74 |all[qq].|theEvent|
|000019a0| 2c 0d 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |,. | |
|000019b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000019c0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 48 61 | | Ha|
|000019d0| 6e 64 6c 65 72 73 54 6f | 49 6e 73 74 61 6c 6c 5b |ndlersTo|Install[|
|000019e0| 71 71 5d 2e 74 68 65 50 | 72 6f 63 2c 20 30 2c 20 |qq].theP|roc, 0, |
|000019f0| 66 61 6c 73 65 29 3b 0d | 20 20 20 20 20 20 20 20 |false);.| |
|00001a00| 20 20 20 20 69 66 20 28 | 61 65 76 74 45 72 72 29 | if (|aevtErr)|
|00001a10| 20 7b 0d 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | {. | |
|00001a20| 20 20 20 2f 2a 20 4f 66 | 20 63 6f 75 72 73 65 2c | /* Of| course,|
|00001a30| 20 79 6f 75 20 63 61 6e | 27 74 20 74 65 6c 6c 20 | you can|'t tell |
|00001a40| 74 68 65 20 75 73 65 72 | 20 77 68 79 20 79 6f 75 |the user| why you|
|00001a50| 20 64 69 65 64 20 64 69 | 72 65 63 74 6c 79 2c 20 | died di|rectly, |
|00001a60| 73 69 6e 63 65 20 79 6f | 75 20 68 61 76 65 20 6e |since yo|u have n|
|00001a70| 6f 20 66 61 63 65 2e 20 | 20 2a 2f 0d 20 20 20 20 |o face. | */. |
|00001a80| 20 20 20 20 20 20 20 20 | 20 20 20 20 2f 2a 20 42 | | /* B|
|00001a90| 75 74 2c 20 79 6f 75 20 | 63 61 6e 20 70 6f 73 74 |ut, you |can post|
|00001aa0| 20 61 20 6e 6f 74 69 66 | 69 63 61 74 69 6f 6e 20 | a notif|ication |
|00001ab0| 66 72 6f 6d 20 68 65 72 | 65 20 74 6f 20 6c 65 74 |from her|e to let|
|00001ac0| 20 74 68 65 6d 20 6b 6e | 6f 77 2e 20 2a 2f 0d 20 | them kn|ow. */. |
|00001ad0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 45 | | E|
|00001ae0| 78 69 74 54 6f 53 68 65 | 6c 6c 28 29 3b 20 20 20 |xitToShe|ll(); |
|00001af0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001b00| 20 20 20 20 20 20 20 20 | 20 20 20 2f 2a 20 6a 75 | | /* ju|
|00001b10| 73 74 20 66 61 69 6c 2c | 20 62 61 62 79 20 2a 2f |st fail,| baby */|
|00001b20| 0d 20 20 20 20 20 20 20 | 20 20 20 20 20 7d 0d 20 |. | }. |
|00001b30| 20 20 20 20 20 20 20 7d | 0d 20 20 20 20 7d 20 65 | }|. } e|
|00001b40| 6c 73 65 20 7b 0d 20 20 | 20 20 20 20 20 20 45 78 |lse {. | Ex|
|00001b50| 69 74 54 6f 53 68 65 6c | 6c 28 29 3b 0d 20 20 20 |itToShel|l();. |
|00001b60| 20 7d 0d 7d 0d 0d 2f 2a | 20 65 6e 64 20 49 6e 69 | }.}../*| end Ini|
|00001b70| 74 41 45 53 74 75 66 66 | 20 2a 2f 0d 0d 76 6f 69 |tAEStuff| */..voi|
|00001b80| 64 20 44 6f 48 69 67 68 | 4c 65 76 65 6c 28 45 76 |d DoHigh|Level(Ev|
|00001b90| 65 6e 74 52 65 63 6f 72 | 64 20 2a 41 45 52 65 63 |entRecor|d *AERec|
|00001ba0| 6f 72 64 29 0d 7b 0d 20 | 20 20 20 2f 2a 20 49 27 |ord).{. | /* I'|
|00001bb0| 6d 20 6e 6f 74 20 64 6f | 69 6e 67 20 61 6e 79 20 |m not do|ing any |
|00001bc0| 65 72 72 6f 72 20 68 61 | 6e 64 6c 69 6e 67 20 68 |error ha|ndling h|
|00001bd0| 65 72 65 20 62 65 63 61 | 75 73 65 20 74 68 65 72 |ere beca|use ther|
|00001be0| 65 27 73 20 6e 6f 74 20 | 61 20 6c 6f 74 20 2a 2f |e's not |a lot */|
|00001bf0| 0d 20 20 20 20 2f 2a 20 | 49 20 63 61 6e 20 64 6f |. /* |I can do|
|00001c00| 2c 20 6a 75 73 74 20 70 | 61 73 73 20 74 68 65 20 |, just p|ass the |
|00001c10| 65 72 72 6f 72 73 20 62 | 61 63 6b 2e 20 2a 2f 0d |errors b|ack. */.|
|00001c20| 20 20 20 20 41 45 50 72 | 6f 63 65 73 73 41 70 70 | AEPr|ocessApp|
|00001c30| 6c 65 45 76 65 6e 74 28 | 41 45 52 65 63 6f 72 64 |leEvent(|AERecord|
|00001c40| 29 3b 0d 20 20 20 20 0d | 7d 0d 0d 2f 2a 20 65 6e |);. .|}../* en|
|00001c50| 64 20 44 6f 48 69 67 68 | 4c 65 76 65 6c 20 2a 2f |d DoHigh|Level */|
|00001c60| 0d 0d 0d 2f 2a 20 54 68 | 69 73 20 69 73 20 74 68 |.../* Th|is is th|
|00001c70| 65 20 73 74 61 6e 64 61 | 72 64 20 4f 70 65 6e 20 |e standa|rd Open |
|00001c80| 41 70 70 6c 69 63 61 74 | 69 6f 6e 20 65 76 65 6e |Applicat|ion even|
|00001c90| 74 2e 20 20 20 2a 2f 0d | 70 61 73 63 61 6c 20 4f |t. */.|pascal O|
|00001ca0| 53 45 72 72 20 41 45 4f | 70 65 6e 48 61 6e 64 6c |SErr AEO|penHandl|
|00001cb0| 65 72 28 41 70 70 6c 65 | 45 76 65 6e 74 20 2a 6d |er(Apple|Event *m|
|00001cc0| 65 73 73 61 67 65 69 6e | 2c 20 41 70 70 6c 65 45 |essagein|, AppleE|
|00001cd0| 76 65 6e 74 20 2a 72 65 | 70 6c 79 2c 20 6c 6f 6e |vent *re|ply, lon|
|00001ce0| 67 20 72 65 66 49 6e 29 | 0d 7b 0d 23 70 72 61 67 |g refIn)|.{.#prag|
|00001cf0| 6d 61 20 75 6e 75 73 65 | 64 20 28 6d 65 73 73 61 |ma unuse|d (messa|
|00001d00| 67 65 69 6e 2c 72 65 70 | 6c 79 2c 72 65 66 49 6e |gein,rep|ly,refIn|
|00001d10| 29 0d 20 20 20 20 2f 2a | 20 77 65 20 6f 66 20 63 |). /*| we of c|
|00001d20| 6f 75 72 73 65 20 64 6f | 6e 27 74 20 64 6f 20 61 |ourse do|n't do a|
|00001d30| 6e 79 74 68 69 6e 67 20 | 68 65 72 65 2c 20 73 69 |nything |here, si|
|00001d40| 6e 63 65 20 77 65 27 72 | 65 20 62 61 63 6b 67 72 |nce we'r|e backgr|
|00001d50| 6f 75 6e 64 20 6f 6e 6c | 79 20 2a 2f 0d 09 2f 2a |ound onl|y */../*|
|00001d60| 20 42 75 74 20 74 68 69 | 73 20 77 61 73 20 61 20 | But thi|s was a |
|00001d70| 6e 6f 72 6d 61 6c 20 6c | 61 75 6e 63 68 2c 20 73 |normal l|aunch, s|
|00001d80| 6f 20 72 65 74 75 72 6e | 20 6e 6f 45 72 72 20 2a |o return| noErr *|
|00001d90| 2f 0d 20 20 20 20 72 65 | 74 75 72 6e 28 6e 6f 45 |/. re|turn(noE|
|00001da0| 72 72 29 3b 0d 7d 0d 0d | 2f 2a 20 65 6e 64 20 41 |rr);.}..|/* end A|
|00001db0| 45 4f 70 65 6e 48 61 6e | 64 6c 65 72 20 2a 2f 0d |EOpenHan|dler */.|
|00001dc0| 0d 2f 2a 20 4f 70 65 6e | 20 44 6f 63 2c 20 6f 70 |./* Open| Doc, op|
|00001dd0| 65 6e 73 20 6f 75 72 20 | 64 6f 63 75 6d 65 6e 74 |ens our |document|
|00001de0| 73 2e 20 2a 2f 0d 2f 2a | 20 49 6e 20 74 68 69 73 |s. */./*| In this|
|00001df0| 20 63 61 73 65 2c 20 6f | 66 20 63 6f 75 72 73 65 | case, o|f course|
|00001e00| 2c 20 79 6f 75 20 61 72 | 65 20 69 6e 20 74 68 65 |, you ar|e in the|
|00001e10| 20 62 61 63 6b 67 72 6f | 75 6e 64 20 73 6f 20 79 | backgro|und so y|
|00001e20| 6f 75 20 73 68 6f 75 6c | 64 20 72 65 74 75 72 6e |ou shoul|d return|
|00001e30| 20 61 6e 20 65 72 72 6f | 72 20 2a 2f 0d 2f 2a 20 | an erro|r */./* |
|00001e40| 68 65 72 65 20 73 69 6e | 63 65 20 79 6f 75 27 72 |here sin|ce you'r|
|00001e50| 65 20 6e 6f 74 20 6f 70 | 65 6e 69 6e 67 20 61 20 |e not op|ening a |
|00001e60| 64 6f 63 75 6d 65 6e 74 | 2e 20 2a 2f 0d 2f 2a 20 |document|. */./* |
|00001e70| 4f 66 20 63 6f 75 72 73 | 65 2c 20 79 6f 75 20 5f |Of cours|e, you _|
|00001e80| 6d 69 67 68 74 5f 20 77 | 61 6e 74 20 74 6f 20 6f |might_ w|ant to o|
|00001e90| 70 65 6e 20 61 20 64 6f | 63 2c 20 62 75 74 20 79 |pen a do|c, but y|
|00001ea0| 6f 75 20 77 69 6c 6c 20 | 70 72 6f 62 61 62 6c 79 |ou will |probably|
|00001eb0| 20 2a 2f 0d 2f 2a 20 63 | 6f 6e 66 75 73 65 20 74 | */./* c|onfuse t|
|00001ec0| 68 65 20 75 73 65 72 20 | 69 66 20 79 6f 75 20 64 |he user |if you d|
|00001ed0| 6f 2c 20 73 69 6e 63 65 | 20 74 68 65 79 20 77 69 |o, since| they wi|
|00001ee0| 6c 6c 20 73 65 65 20 6e | 6f 20 61 63 74 69 6f 6e |ll see n|o action|
|00001ef0| 20 61 73 20 74 68 65 20 | 2a 2f 0d 2f 2a 20 20 72 | as the |*/./* r|
|00001f00| 65 73 75 6c 74 20 6f 66 | 20 74 68 65 69 72 20 63 |esult of| their c|
|00001f10| 6c 69 63 6b 69 6e 67 20 | 6f 6e 20 61 20 64 6f 63 |licking |on a doc|
|00001f20| 75 6d 65 6e 74 20 69 63 | 6f 6e 2e 20 2a 2f 0d 70 |ument ic|on. */.p|
|00001f30| 61 73 63 61 6c 20 4f 53 | 45 72 72 20 41 45 4f 70 |ascal OS|Err AEOp|
|00001f40| 65 6e 44 6f 63 48 61 6e | 64 6c 65 72 28 41 70 70 |enDocHan|dler(App|
|00001f50| 6c 65 45 76 65 6e 74 20 | 2a 6d 65 73 73 61 67 65 |leEvent |*message|
|00001f60| 69 6e 2c 20 41 70 70 6c | 65 45 76 65 6e 74 20 2a |in, Appl|eEvent *|
|00001f70| 72 65 70 6c 79 2c 20 6c | 6f 6e 67 20 72 65 66 49 |reply, l|ong refI|
|00001f80| 6e 29 0d 7b 0d 23 70 72 | 61 67 6d 61 20 75 6e 75 |n).{.#pr|agma unu|
|00001f90| 73 65 64 20 28 72 65 70 | 6c 79 2c 20 72 65 66 49 |sed (rep|ly, refI|
|00001fa0| 6e 2c 6d 65 73 73 61 67 | 65 69 6e 29 0d 20 20 20 |n,messag|ein). |
|00001fb0| 20 2f 2a 20 77 65 20 6f | 66 20 63 6f 75 72 73 65 | /* we o|f course|
|00001fc0| 20 64 6f 6e 27 74 20 64 | 6f 20 61 6e 79 74 68 69 | don't d|o anythi|
|00001fd0| 6e 67 20 68 65 72 65 2c | 20 73 6f 20 74 65 6c 6c |ng here,| so tell|
|00001fe0| 20 74 68 65 20 73 65 6e | 64 65 72 20 74 68 61 74 | the sen|der that|
|00001ff0| 20 77 65 20 20 2a 2f 0d | 20 20 20 20 2f 2a 20 64 | we */.| /* d|
|00002000| 69 64 6e 27 74 20 68 61 | 6e 64 6c 65 20 74 68 65 |idn't ha|ndle the|
|00002010| 20 65 76 65 6e 74 20 2a | 2f 0d 20 20 20 20 72 65 | event *|/. re|
|00002020| 74 75 72 6e 28 65 72 72 | 41 45 45 76 65 6e 74 4e |turn(err|AEEventN|
|00002030| 6f 74 48 61 6e 64 6c 65 | 64 29 3b 0d 7d 0d 0d 2f |otHandle|d);.}../|
|00002040| 2a 20 73 61 6d 65 20 6c | 6f 67 69 63 20 66 6f 72 |* same l|ogic for|
|00002050| 20 70 72 69 6e 74 69 6e | 67 20 2a 2f 0d 70 61 73 | printin|g */.pas|
|00002060| 63 61 6c 20 4f 53 45 72 | 72 20 41 45 50 72 69 6e |cal OSEr|r AEPrin|
|00002070| 74 48 61 6e 64 6c 65 72 | 28 41 70 70 6c 65 45 76 |tHandler|(AppleEv|
|00002080| 65 6e 74 20 2a 6d 65 73 | 73 61 67 65 69 6e 2c 20 |ent *mes|sagein, |
|00002090| 41 70 70 6c 65 45 76 65 | 6e 74 20 2a 72 65 70 6c |AppleEve|nt *repl|
|000020a0| 79 2c 20 6c 6f 6e 67 20 | 72 65 66 49 6e 29 0d 7b |y, long |refIn).{|
|000020b0| 0d 23 70 72 61 67 6d 61 | 20 75 6e 75 73 65 64 20 |.#pragma| unused |
|000020c0| 28 72 65 70 6c 79 2c 72 | 65 66 49 6e 2c 6d 65 73 |(reply,r|efIn,mes|
|000020d0| 73 61 67 65 69 6e 29 0d | 20 20 20 20 2f 2a 20 77 |sagein).| /* w|
|000020e0| 65 20 6f 66 20 63 6f 75 | 72 73 65 20 64 6f 6e 27 |e of cou|rse don'|
|000020f0| 74 20 64 6f 20 61 6e 79 | 74 68 69 6e 67 20 68 65 |t do any|thing he|
|00002100| 72 65 20 2a 2f 0d 20 20 | 20 20 72 65 74 75 72 6e |re */. | return|
|00002110| 28 65 72 72 41 45 45 76 | 65 6e 74 4e 6f 74 48 61 |(errAEEv|entNotHa|
|00002120| 6e 64 6c 65 64 29 3b 0d | 7d 0d 0d 2f 2a 20 53 74 |ndled);.|}../* St|
|00002130| 61 6e 64 61 72 64 20 51 | 75 69 74 20 65 76 65 6e |andard Q|uit even|
|00002140| 74 20 68 61 6e 64 6c 65 | 72 2c 20 74 6f 20 68 61 |t handle|r, to ha|
|00002150| 6e 64 6c 65 20 61 20 51 | 75 69 74 20 65 76 65 6e |ndle a Q|uit even|
|00002160| 74 20 66 72 6f 6d 20 74 | 68 65 20 46 69 6e 64 65 |t from t|he Finde|
|00002170| 72 2c 20 66 6f 72 20 65 | 78 61 6d 70 6c 65 2e 20 |r, for e|xample. |
|00002180| 20 2a 2f 0d 2f 2a 20 a5 | a5 a5 a5 a5 20 44 4f 20 | */./* .|.... DO |
|00002190| 4e 4f 54 20 43 41 4c 4c | 20 45 58 49 54 54 4f 53 |NOT CALL| EXITTOS|
|000021a0| 48 45 4c 4c 20 48 45 52 | 45 20 a5 a5 a5 a5 a5 20 |HELL HER|E ..... |
|000021b0| 6f 72 20 79 6f 75 20 77 | 69 6c 6c 20 6e 65 76 65 |or you w|ill neve|
|000021c0| 72 20 68 61 76 65 20 61 | 20 68 61 70 70 79 20 6c |r have a| happy l|
|000021d0| 69 66 65 2e 20 20 2a 2f | 0d 70 61 73 63 61 6c 20 |ife. */|.pascal |
|000021e0| 4f 53 45 72 72 20 41 45 | 51 75 69 74 48 61 6e 64 |OSErr AE|QuitHand|
|000021f0| 6c 65 72 28 41 70 70 6c | 65 45 76 65 6e 74 20 2a |ler(Appl|eEvent *|
|00002200| 6d 65 73 73 61 67 65 69 | 6e 2c 20 41 70 70 6c 65 |messagei|n, Apple|
|00002210| 45 76 65 6e 74 20 2a 72 | 65 70 6c 79 2c 20 6c 6f |Event *r|eply, lo|
|00002220| 6e 67 20 72 65 66 49 6e | 29 0d 7b 0d 23 70 72 61 |ng refIn|).{.#pra|
|00002230| 67 6d 61 20 75 6e 75 73 | 65 64 20 28 6d 65 73 73 |gma unus|ed (mess|
|00002240| 61 67 65 69 6e 2c 72 65 | 66 49 6e 2c 72 65 70 6c |agein,re|fIn,repl|
|00002250| 79 29 0d 20 20 20 20 65 | 78 74 65 72 6e 20 42 6f |y). e|xtern Bo|
|00002260| 6f 6c 65 61 6e 20 51 75 | 69 74 3b 0d 20 20 20 20 |olean Qu|it;. |
|00002270| 2f 2a 20 20 54 68 69 73 | 20 64 6f 65 73 20 5f 4e |/* This| does _N|
|00002280| 4f 54 5f 20 71 75 69 74 | 2c 20 79 6f 75 20 2a 2f |OT_ quit|, you */|
|00002290| 0d 20 20 20 20 2f 2a 20 | 73 68 6f 75 6c 64 20 4e |. /* |should N|
|000022a0| 45 56 45 52 20 71 75 69 | 74 20 66 72 6f 6d 20 61 |EVER qui|t from a|
|000022b0| 6e 20 41 70 70 6c 65 45 | 76 65 6e 74 20 68 61 6e |n AppleE|vent han|
|000022c0| 64 6c 65 72 2e 20 20 43 | 61 6c 6c 69 6e 67 20 2a |dler. C|alling *|
|000022d0| 2f 0d 20 20 20 20 2f 2a | 20 45 78 69 74 54 6f 53 |/. /*| ExitToS|
|000022e0| 68 65 6c 6c 20 68 65 72 | 65 20 77 6f 75 6c 64 20 |hell her|e would |
|000022f0| 62 6c 6f 77 20 75 70 20 | 74 68 65 20 46 69 6e 64 |blow up |the Find|
|00002300| 65 72 aa 20 2a 2f 0d 09 | 53 65 74 52 65 73 74 28 |er. */..|SetRest(|
|00002310| 29 3b 0d 09 53 65 74 53 | 79 73 53 6c 65 65 70 28 |);..SetS|ysSleep(|
|00002320| 67 53 79 73 53 6c 65 65 | 70 29 3b 0d 09 53 65 74 |gSysSlee|p);..Set|
|00002330| 48 44 53 6c 65 65 70 28 | 67 48 44 53 6c 65 65 70 |HDSleep(|gHDSleep|
|00002340| 29 3b 0d 20 20 20 20 67 | 51 75 69 74 20 3d 20 74 |);. g|Quit = t|
|00002350| 72 75 65 3b 0d 20 20 20 | 20 72 65 74 75 72 6e 28 |rue;. | return(|
|00002360| 6e 6f 45 72 72 29 3b 0d | 7d 0d 00 00 00 00 00 00 |noErr);.|}.......|
|00002370| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002380| 00 00 01 00 00 00 01 6e | 00 00 00 6e 00 00 00 3e |.......n|...n...>|
|00002390| 00 00 49 d0 0e 53 61 6d | 70 6c 65 45 72 72 6f 72 |..I..Sam|pleError|
|000023a0| 73 2e 63 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |s.c.....|........|
|000023b0| 06 6d 61 69 6e 2e 63 b4 | 02 00 00 00 50 61 72 74 |.main.c.|....Part|
|000023c0| 53 49 54 78 00 00 00 00 | 00 00 00 00 00 01 85 61 |SITx....|.......a|
|000023d0| 00 00 50 61 72 74 53 49 | 54 78 00 00 00 00 00 00 |..PartSI|Tx......|
|000023e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000023f0| 00 00 a9 81 49 0d 00 00 | 00 00 00 00 01 ac 00 00 |....I...|........|
|00002400| 00 00 00 00 00 00 00 00 | 00 00 06 07 25 00 00 00 |........|....%...|
|00002410| 49 d0 18 54 72 61 66 66 | 69 63 20 4c 69 67 68 74 |I..Traff|ic Light|
|00002420| 20 32 2e 30 2e b9 2e 72 | 73 72 63 00 00 00 00 00 | 2.0...r|src.....|
|00002430| 00 00 00 00 05 2e 25 00 | 00 00 4a fa 00 00 00 00 |......%.|..J.....|
|00002440| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002450| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 56 |........|.......V|
|00002460| 25 00 00 00 4a fa 0c 53 | 79 73 37 57 44 45 46 2e |%...J..S|ys7WDEF.|
|00002470| 50 4b 47 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |PKG.....|........|
|00002480| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 6f 74 68 |...H..Mo|naco.oth|
|00002490| 69 6e 67 20 62 75 74 20 | 65 76 65 6e 74 73 20 2a |ing but |events *|
|000024a0| 2f 0d 09 20 77 68 00 06 | 00 04 ff b7 02 d8 01 8b |/.. wh..|........|
|000024b0| 05 8f ff b7 02 d8 01 8b | 05 8f a5 4e ab 78 00 00 |........|...N.x..|
|000024c0| 1b 0b 00 00 1b 0b 00 00 | 00 00 01 00 00 00 00 1e |........|........|
|000024d0| ff b7 02 d8 01 8b 05 8f | ff b7 02 d8 01 8b 05 8f |........|........|
|000024e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000024f0| 01 00 00 00 01 6e 00 00 | 00 6e 00 00 00 3e 00 44 |.....n..|.n...>.D|
|00002500| 4d 78 06 40 00 00 00 1c | 00 3e 00 00 4d 50 53 52 |Mx.@....|.>..MPSR|
|00002510| 00 01 00 0a 03 ed ff ff | 00 00 00 00 00 00 00 00 |........|........|
|00002520| 03 f0 ff ff 00 00 00 4c | 00 00 00 00 00 00 00 00 |.......L|........|
|00002530| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002540| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002550| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+